window.onload = function(){
	document.getElementById("install_bgjz_zs").classList.add("width33");
}
var inclickx = false;

// 是否已经勾选已阅读
function inclick(){
	if(inclickx){
		document.getElementById("confirm_k").style.backgroundImage = "url()";
		document.getElementById("confirm_w").style.color = "#66ccff";
		document.getElementById("confirm_k").style.border = "2px solid #66ccff";
		inclickx = false;
	}else{
		document.getElementById("confirm_k").style.backgroundImage = "url(install_data/true.png)";
		document.getElementById("confirm_w").style.color = "#d5d5d5";
		document.getElementById("confirm_k").style.border = "2px solid #bfbfbf";
		document.getElementById("confirm_w").style.borderBottom = "0px";
		inclickx = true;
	}
}

// 阅读下一步点击
function pagetion(){
	if(inclickx){
		// 页面切换
		document.getElementById("install_state").style.display = "none";
		document.getElementById("install_data").style.display = "block";
		// 进度条调整
		document.getElementById("install_bgjz_zs").classList.remove("width33");
		document.getElementById("install_bgjz_zs").classList.add("width66");
		// 文字进度调整
		document.getElementById("bgli1").classList.remove("install_bg_xz");
		document.getElementById("bgli2").classList.add("install_bg_xz");
	}else{
		document.getElementById("confirm_w").style.color = "#fc6767";
		document.getElementById("confirm_k").style.border = "2px solid #fc6767";
		document.getElementById("confirm_w").style.borderBottom = "1px dashed #fc6767";
	}
}

// 提交判断
function ondb(){
	if(document.form1.host.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 数据库地址 ]</b> 不能为空！"
		return false;
    }else if(document.form1.port.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 数据库端口 ]</b> 不能为空！"
		return false;
    }else if(document.form1.dbname.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 数据库名称 ]</b> 不能为空！"
		return false;
    }else if(document.form1.dbpsw.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 数据库密码 ]</b> 不能为空！"
		return false;
    }else if(document.form1.dbtuser.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 用户表名 ]</b> 不能为空！"
		return false;
    }else if(document.form1.adminname.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 管理员账号 ]</b> 不能为空！"
		return false;
    }else if(document.form1.adminpsd.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 管理员密码 ]</b> 第一次不能为空！"
		return false;
    }else if(document.form1.adminpsd2.value==""){
		document.getElementById("dbts").innerHTML = "<b>[ 管理员密码 ]</b> 第二次不能为空！"
		return false;
    }else if(document.form1.adminpsd2.value.length<6){
		document.getElementById("dbts").innerHTML = "<b>[ 管理员密码 ]</b> 不能小于6位密码！"
		return false;
    }else if(document.form1.adminpsd.value.length == document.form1.adminpsd.value){
		document.getElementById("dbts").innerHTML = ""
		return true;
    }
	
	var adminpsd1 = document.form1.adminpsd.value;
	var adminpsd2 = document.form1.adminpsd2.value;
	if(adminpsd1 != adminpsd2){
		document.getElementById("onpsw").innerHTML = "<span style='color:red;font-weight: 800;'>警告！两次密码不一致！</span>"
		document.getElementById("dbts").innerHTML = "<b>[ 管理员密码 ]</b> 两次管理员密码不正确！"
		return false;
	}else{
		document.getElementById("onpsw").innerHTML = "<span>请牢记您的密码！</span>"
	}
	
	return true;
}

// 临时判断两次密码是否一致
function ondbpsw(){
	var adminpsd1 = document.form1.adminpsd.value;
	var adminpsd2 = document.form1.adminpsd2.value;
	if(document.form1.adminpsd2.value.length<6){
		document.getElementById("onpsw").innerHTML = "<span>[ 管理员密码 ]</span> 不能小于6位密码！"
	}else{
		if(adminpsd1 != adminpsd2){
			document.getElementById("onpsw").innerHTML = "<span style='color:red;font-weight: 800;'>警告！两次密码不一致！</span>"
			document.getElementById("onpsw1").innerHTML = ""
		}else{
			document.getElementById("onpsw").innerHTML = "<span>请牢记您的密码！</span>"
			document.getElementById("onpsw1").innerHTML = ""
		}
	}
}
function ondbpsw1(){
	if(document.form1.adminpsd.value.length<6){
		document.getElementById("onpsw1").innerHTML = "<span>[ 管理员密码 ]</span> 不能小于6位密码！"
	}else{
		document.getElementById("onpsw1").innerHTML = "请进行二次密码验证！"
		document.getElementById("onpsw").innerHTML = "<span style='color:red;font-weight: 800;'>警告！两次密码不一致！</span>"
		
		var adminpsd1 = document.form1.adminpsd.value;
		var adminpsd2 = document.form1.adminpsd2.value;
		if(document.form1.adminpsd2.value.length<6){
			document.getElementById("onpsw").innerHTML = "<span>[ 管理员密码 ]</span> 不能小于6位密码！"
		}else{
			if(adminpsd1 != adminpsd2){
				document.getElementById("onpsw").innerHTML = "<span style='color:red;font-weight: 800;'>警告！两次密码不一致！</span>"
				document.getElementById("onpsw1").innerHTML = ""
			}else{
				document.getElementById("onpsw").innerHTML = "<span>请牢记您的密码！</span>"
				document.getElementById("onpsw1").innerHTML = ""
			}
		}
	}
}

// 关闭展示条
function popup_x(){
	document.getElementById("popup").style.right = "-240px";
	document.getElementById("popup").style.width = "230px";
}